
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title>新建收货地址</title>
<link href="__INDEX__/tem/css/mui.min.css" rel="stylesheet" />
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="__INDEX__/tem/css/app.css" />
<link rel="stylesheet" href="__INDEX__/tem/css/style.css" />
<link rel="stylesheet" href="__INDEX__/tem/css/iconfont.css" />
<link rel="stylesheet" href="__INDEX__/tem/css/xn.css" />
</head>

<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title">新建收货地址</h1>
	</header>
	<div class="mui-content">
			<form id="myForm" class="mui-input-group gerenzl_group">
		<ul class="shdzlisbox">
			<li>
				<label>收货人</label>
				<input type="text" placeholder="填写收货人姓名" name="realname" />
			</li>
			<li>
				<label>手机号码</label>
				<input type="text" placeholder="填写手机号码" name="mobile"/>
			</li>
			<li>
				<label>所在地区</label>
				<input type="text" readonly="" placeholder="请选择地区" id="myAddrs" data-key="" value="">
				<input type="hidden" id="area" name="area" value="" />
			</li>
			<li>
				<label>详细地址</label>
				<input type="text" placeholder="填写详细地址" name="address" />
			</li>
		</ul>
			<div class="mui-input-row mui-radio shdz_mor">
				<label>设为默认</label>
				<input name="isdefault" type="radio" value="1" checked>
			</div>
		<button type="submit" class="zjt_pbtn">保存地址</button>
		</form>
	</div>
	
</body>
</html>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.validate.min.js"></script>
<script src="__JS__/mui.min.js"></script>
<script src="__LIB__/layer.js"></script>
<script src="__JS__/index.js"></script>
<link href="__JS__/scs.min.css" rel="stylesheet">
<script src="__JS__/jquery.scs.min.js"></script>
<script src="__JS__/district.js"></script>
<script>

	$(function() {
		$("#myForm").validate({
			focusInvalid: true,
			onkeyup: false,
			ignore: "",
			onfocusout: false,
			showErrors: function(errorMap, errorList) {
				var msg = "";
				if(errorList != null && errorList != "") {
					msg = errorList[0]['message'];
					layer.msg(msg);
				}
			},
			submitHandler: function(form) { //表单提交句柄,为一回调函数，带一个参数：form   
				app.ajax(window.location.href, true);
			},
			rules: {
				realname: {
					required: true
				},
				mobile: {
					required: true
				},
				area: {
					required: true
				},
				address: {
					required: true
				}
			},
			messages: {
				realname: {
					required: "填写收货人姓名"
				},
				mobile: {
					required: "填写手机号码"
				},
				area: {
					required: "请选择地区"
				},
				address: {
					required: "填写详细地址"
				}
			}
		});
	});
</script>